package priv.yiyuan.example.composite;

/**
 * 文件系统组件接口
 *
 * @author YiYuan
 * @data 2025/8/28
 * @apoNote
 */
public interface FileSystemComponent {

    String getName();

    long getSize();

    void display(String indent);

    void accept(FileSystemVisitor visitor);

    default void add(FileSystemComponent component){
        throw new UnsupportedOperationException("叶子节点不包含子组件! ");
    }

    default void remove(FileSystemComponent component){
        throw new UnsupportedOperationException("叶子节点不包含子组件! ");
    }

    default FileSystemComponent getChild(int i){
        throw new UnsupportedOperationException("叶子节点不包含子组件! ");
    }
}
